﻿using HandyControl.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace EONFULLSIN2.Services.Message
{
    /// <summary>
    /// 消息服务
    /// </summary>
    public class MessageService : IMessageService
    {
        #region MessageBox
        public MessageBoxResult Show(MessageBoxInfo info)
        {
            return HandyControl.Controls.MessageBox.Show(info);
        }

        public MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage icon = MessageBoxImage.None, MessageBoxResult defaultResult = MessageBoxResult.None)
        {
            return HandyControl.Controls.MessageBox.Show(messageBoxText, caption, button, icon, defaultResult);
        }

        public MessageBoxResult Show(Window owner, string messageBoxText, string caption, MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage icon = MessageBoxImage.None, MessageBoxResult defaultResult = MessageBoxResult.None)
        {
            return HandyControl.Controls.MessageBox.Show(owner, messageBoxText, caption, button, icon, defaultResult);
        }

        public MessageBoxResult Ask(string messageBoxText, string caption)
        {
            return HandyControl.Controls.MessageBox.Ask(messageBoxText, caption);
        }


        public MessageBoxResult Error(string messageBoxText, string caption)
        {
            return HandyControl.Controls.MessageBox.Error(messageBoxText, caption);
        }

        public MessageBoxResult Fatal(string messageBoxText, string caption)
        {
            return HandyControl.Controls.MessageBox.Fatal(messageBoxText, caption);
        }

        public MessageBoxResult Info(string messageBoxText, string caption)
        {
            return HandyControl.Controls.MessageBox.Info(messageBoxText, caption);
        }

        public MessageBoxResult Success(string messageBoxText, string caption)
        {
            return HandyControl.Controls.MessageBox.Success(messageBoxText, caption);
        }

        public MessageBoxResult Warning(string messageBoxText, string caption)
        {
            return HandyControl.Controls.MessageBox.Warning(messageBoxText, caption);
        }
        #endregion

        #region Growl
        public void GrowlInfo(string message, string token = null)
        {
            HandyControl.Controls.Growl.Info(message, token);
        }

        public void GrowSuccess(string message, string token = null)
        {
            HandyControl.Controls.Growl.Success(message, token);
        }

        public void GrowWarning(string message, string token = null)
        {
            HandyControl.Controls.Growl.Warning(message, token);
        }

        public void GrowError(string message, string token = null)
        {
            HandyControl.Controls.Growl.Error(message, token);
        }

        public void GrowAsk(string message, Func<bool, bool> actionBeforeClose, string token = null)
        {
            HandyControl.Controls.Growl.Ask(message, actionBeforeClose, token);
        }

        #endregion

        #region GrowlGlobal
        public void GrowlInfoGlobal(string message)
        {
            HandyControl.Controls.Growl.InfoGlobal(message);
        }

        public void GrowSuccessGlobal(string message)
        {
            HandyControl.Controls.Growl.SuccessGlobal(message);
        }

        public void GrowWarningGlobal(string message)
        {
            HandyControl.Controls.Growl.WarningGlobal(message);
        }

        public void GrowErrorGlobal(string message)
        {
            HandyControl.Controls.Growl.ErrorGlobal(message);
        }

        public void GrowAskGlobal(string message, Func<bool, bool> actionBeforeClose)
        {
            HandyControl.Controls.Growl.AskGlobal(message, actionBeforeClose);
        }
        #endregion
    }
}
